package com.fjzzct.report.utils;

/**
 * Created by cwb on 2015/8/7.
 */
public class PaginationHelper {

    public static String BuildPaginationSql(String sql,String orderby,int page,int rows)
    {
        String PageSql="select * from ( " +
                " select row_limit.*,Row_Number() over (order by "+orderby+") as rn " +
                " from ("+sql+
                " ) row_limit " +
                " ) t where　rn between '"+((page-1)*rows+1)+"' and '"+page*rows+"' ";
        return  PageSql;
    }

}
